<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/common/global.jsp"%>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1">
    <title>购物车</title>
    <link rel="stylesheet" href="${ctxPath}/static/css/shopping.css"/>
    <script type="text/javascript" src="${ctxPath}/static/js/jquery-1.12.1.min.js"></script>
    <%--<script type="text/javascript" src="${ctxPath}/static/js/qxsp.js"></script>--%>
    <script type="text/javascript" src="${ctxPath}/static/js/shoppingCart.js"></script>
</head>
<body>
<div class="body">
    <div class="tour">
        <%--<a href="${cxtPath}/home/index" class="tour1"><img src="${ctxPath}/static/images/img/back.png" alt="" style="height: 26px;width: 20px"></a>--%>
        <p>购物车</p>
        <a href="javascript:;" class="tour2"><i class="btn"></i></a>
        <input type="hidden" id="catr_id" value="${busiCartId}">
        <input type="hidden" id="ctxPath" value="${ctxPath}">
    </div>
    <%--<div class="spxz">--%>
        <%--<ul>--%>
            <%--<li class="li1"><input type="checkbox" value="${article.id}" name="box"/></li>--%>
            <%--<li class="li2"><a href="spxq.html"><img src="${ctxPath}/static/images/img/u67.png" alt="" style="width: 60px;height: 60px"/></a></li>--%>
            <%--<li class="li3"><span>商品名称</span><br><span style="color: red" ></span><input type="text" value="100.00" class="one" disabled="disabled"></li>--%>
            <%--<li class="li4"><div><a class="reduce" >-</a><input type="text" value="1" class="num"/><a class="plus">+</a></div></li>--%>
        <%--</ul>--%>
    <%--</div>--%>
    <div id="cartItems">
    <c:choose>
        <c:when test="${!empty busiCartDetailItems}">
            <c:forEach items="${busiCartDetailItems}"  var="detailItem">
                <div class="spxz">
                    <ul>

                        <li class="li1"><input type="checkbox" value="${detailItem.id}" name="box" onclick="checkOne(this)"/></li>
                        <li class="li2"><a href=""><img src="${staticServer}/${detailItem.standy1}" alt="" style="width: 60px;height: 60px"/></a></li>
                        <li class="li3"><span class="desc">${detailItem.standy2}</span><br><span style="color: red" ></span><input type="text" value="<fmt:formatNumber value="${detailItem.prodPrice}" type="currency" pattern="#.##"/>" class="one" disabled="disabled"></li>
                        <li class="li4"><div><a class="reduce" >-</a><input type="text" id="num_${detailItem.id}" value="${detailItem.sum}" class="num"/><a class="plus" onclick="">+</a></div></li>
                    </ul>
                </div>
            </c:forEach>
        </c:when>

        <c:otherwise>
            暂无商品！
        </c:otherwise>
    </c:choose>
    </div>


</div>
<div style="clear: both"></div>
<div class="footing">
    <ul>
        <li class="li5"><input type="checkbox" id="checkbox" value="1" onclick="check()" />全选</li>
        <li class="li6">合计：<span class="red" id="total">￥100.00</span></li>
        <li class="li7"><button type="button" onclick="do_settlement()">结算</button></li>
    </ul>
</div>
    <div class="alert">
       <table border="1" cellSpacing=0  style="width: 100%;text-align: center;border-spacing:0;BORDER-COLLAPSE: collapse">
           <tr>
               <td colspan="2">
                   <div style="padding: 0.5rem 0 0.5rem 0;font-size: 1.6rem">提示</div>
                   <div style="padding: 0.5rem 0 0.5rem 0;font-size: 1.6rem">确定删除当前商品?</div>
               </td>
           </tr>
           <tr>
               <td><button type="button" class="delete" style="border: none;outline: none;background-color: white;font-size: 1.6rem;padding: 0.5rem 0 0.5rem 0;width:100%">确定</button></td>
               <td><button type="button" class="none" style="border: none;outline: none;background-color: white;font-size: 1.6rem;padding: 0.5rem 0 0.5rem 0;width:100%">取消</button></td>
           </tr>
       </table>
    </div>
<div class="theme-popover-mask"></div>
<%@include file="/common/footer.jsp"%>
</body>
<!-- 复选框 -->
<script type="text/javascript">

<%--function settlement(){--%>
    <%--//获取购物车id--%>
    <%--var catrId = $("#catr_id").val();--%>
    <%--//获取购物车清单项id--%>
    <%--var catrItemIds = [];--%>
    <%--$('input[name="box"]').each(function(){--%>
        <%--if(this.checked){--%>
            <%--catrItemIds.push(this.value);--%>
        <%--}--%>
    <%--});--%>
    <%--var ss = catrItemIds.join(",");--%>
    <%--//获取购物车清单项数量num--%>
    <%--var itemCounts = [];--%>
    <%--$('input[name="box"]').each(function(){--%>
        <%--if(this.checked){--%>
            <%--itemCounts.push(this.value);--%>
        <%--}--%>
    <%--});--%>
    <%--var Counts = itemCounts.join(",");--%>
    <%--//获取总金额--%>
    <%--var totalAmount =  $("#total").html();--%>
    <%--totalAmount = totalAmount.replace('￥','');--%>
    <%--$.ajax({--%>
        <%--url:"${ctxPath}/busiCart/cart_settlement",--%>
        <%--type:"POST",--%>
        <%--data:{"catrId":catrId,"catrItemIds":ss,"totalAmount":totalAmount,"Counts":Counts},--%>
        <%--dataType:"JSON",--%>
        <%--success:function(data){--%>
            <%--logger.info(JSON.stringify(data));--%>
            <%--if (data.status == "200") {--%>
                <%--layer.msg('处理成功！'--%>
                    <%--,{--%>
                        <%--icon: 1,--%>
                        <%--time: 3000, //3s后自动关闭--%>
                        <%--btn: ['确定']--%>
                    <%--})--%>
            <%--} else {--%>
                <%--layer.msg('处理失败！', {icon: 1});--%>
            <%--}--%>
        <%--},--%>
        <%--error:function(data){--%>
            <%--logger.error(JSON.stringify(data));--%>
        <%--}--%>
    <%--});--%>
<%--}--%>


</script>
</html>